<?php
$score=isset($_GET["score"]) ? intval($_GET["score"]) : '';
$id=isset($_GET["id"]) ? intval($_GET["id"]) : '';
$con = mysqli_connect('localhost','root','');
if (!$con)
{
    die('Could not connect: ' . mysqli_error($con));
}
// 选择数据库
mysqli_select_db($con,"uml");
// 设置编码，防止中文乱码
mysqli_set_charset($con, "utf8");
$sqlupdate="update playertable set grade=$score where playerId=$id";
$succ=mysqli_query($con,$sqlupdate);
if ($succ>0){
    echo '已为编号'.$id.'打分'.$score."<br>";

    echo "<a href='index.html'>返回继续评分</a>";
}
mysqli_close($con);
?>
